<style>
    .disabled{
        display: table-cell;
    }
</style>
<div ng-include src="'tpl/public/header.html?1'"></div>
<div class="contents">
    <ol class="breadcrumb">
        <li><a href="#/index/panel">首页</a></li>
        <li><a href="#/shop/information/list">资讯列表</a></li>
        <li class="active">{{information.item.id ? '编辑' : '添加'}}</li>
    </ol>
    <form class="form-horizontal" role="form" name="form" novalidate ng-submit="save()">
        <div class="form-group" ng-class="{'has-error':form.type.$invalid}">
            <label class="col-sm-2 control-label">
                <span class="required">*</span> 类型
            </label>
            <div class="col-sm-8">
                <label class="radio-inline">
                    <input type="radio" name="type" value="1" required="required" ng-model="information.item.type">即时快讯
                </label>
                <label class="radio-inline">
                    <input type="radio" name="type" value="2" required="required" ng-model="information.item.type">资讯简报
                </label>
                <label class="radio-inline">
                    <input type="radio" name="type" value="3" required="required" ng-model="information.item.type">热点资讯
                </label>
                <label class="radio-inline">
                    <input type="radio" name="type" value="4" required="required" ng-model="information.item.type">早鸟理财师驿站
                </label>
            </div>
        </div>

        <div class="form-group" ng-class="{'has-error':form.title.$invalid}">
            <label class="col-sm-2 control-label">
                <span class="required">*</span> 标题
            </label>
            <div class="col-sm-8">
                <input type="text" class="form-control" autocomplete="off" value="" name="title" maxlength="100" ng-model="information.item.title" required="required" placeholder="标题">
            </div>
        </div>

        <div class="form-group" ng-class="{'has-error':form.birefDesc.$invalid}">
            <label class="col-sm-2 control-label">
                <span class="required">*</span> 摘要
            </label>
            <div class="col-sm-8">
                <textarea class="form-control" autocomplete="off" value="" rows="3" name="birefDesc" ng-model="information.item.birefDesc" required="required" placeholder="摘要内容"></textarea>
            </div>
        </div>

        <div class="form-group" ng-class="{'has-error':!information.item.hotImg}" ng-show="information.item.type=='3'||information.item.type=='2'">
            <label class="col-sm-2 control-label">
                <span class="required">*</span> {{information.item.type=='2'&&'资讯简报缩略图'||information.item.type=='3'&&'热点资讯缩略图'}}
            </label>
            <div class="col-sm-8">
                <div style="width: 80px;height: 80px;overflow: hidden;margin-top: 10px;border:1px solid #ddd;">
                    <img ng-src="{{information.item.hotImg}}" alt="" style="width: 100%;height: 100%;">
                </div>
                <div class="btn btn-primary add-pic-btn">上传图片</div>
            </div>
        </div>

        <div class="form-group" ng-class="{'has-error':form.articleLink.$invalid}" ng-if="information.item.type=='2'">
            <label class="col-sm-2 control-label">
                <span class="required">*</span> 文章链接
            </label>
            <div class="col-sm-8">
                <input type="text" class="form-control" autocomplete="off" value="" name="articleLink" ng-model="information.item.articleLink" required="required" placeholder="文章链接">
            </div>
        </div>

        <div class="form-group" ng-class="{'has-error':form.content.$invalid}" ng-if="information.item.type != 2">
            <label class="col-sm-2 control-label">
                <span class="required">*</span>
                正文
            </label>
            <div class="col-sm-8">
                <div class="ueditor" config="config" ready="ready" name="content" ng-model="information.item.content" style="height:300px;" required></div>
            </div>
        </div>

        <div class="form-group" ng-class="{'has-error':form.pushMeg.$invalid}">
            <label class="col-sm-2 control-label">
                <span class="required">*</span> 是否推送消息
            </label>
            <div class="col-sm-8">
                <label class="radio-inline">
                    <input type="radio" name="pushMeg" value="1" required="required" ng-model="information.item.pushMeg">是
                </label>
                <label class="radio-inline">
                    <input type="radio" name="pushMeg" value="2" required="required" ng-model="information.item.pushMeg">否
                </label>
            </div>
        </div>

        <div class="form-group" ng-class="{'has-error':form.upStatus.$invalid}">
            <label class="col-sm-2 control-label">
                <span class="required">*</span> 是否上架
            </label>
            <div class="col-sm-8">
                <label class="radio-inline">
                    <input type="radio" name="upStatus" value="1" required="required" ng-model="information.item.upStatus">是
                </label>
                <label class="radio-inline">
                    <input type="radio" name="upStatus" value="2" required="required" ng-model="information.item.upStatus">否
                </label>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">
                预发布时间
            </label>
            <div class="col-sm-8">
                <div class="input-group"
                     moment-picker="information.item.preTime"
                     format="YYYY-MM-DD HH:mm" start-view="day" min-date="minDate">
                    <span class="input-group-addon">
                        <i class="glyphicon glyphicon-calendar"></i>
                    </span>
                    <input class="form-control" name="preTime"
                           placeholder="预发布时间"
                           ng-model="information.item.preTime">
                </div>
            </div>
        </div>

        <div class="form-group" ng-class="{'has-error':form.commentName.$invalid}" ng-if="information.item.type=='3'">
            <label class="col-sm-2 control-label">
                <span class="required">*</span> 评论人姓名
            </label>
            <div class="col-sm-8">
                <input type="text" class="form-control" autocomplete="off" value="" maxlength="20" name="commentName" ng-model="information.item.commentName" required="required" placeholder="评论人姓名">
            </div>
        </div>
        <div class="form-group" ng-class="{'has-error':!information.item.commentHeaderurl}" ng-show="information.item.type=='3'">
            <label class="col-sm-2 control-label">
                <span class="required">*</span> 评论人头像
            </label>
            <div class="col-sm-8">
                <div style="width: 80px;height: 80px;border-radius: 50%;overflow: hidden;margin-top: 10px;border:1px solid #ddd;">
                    <img ng-src="{{information.item.commentHeaderurl}}" alt="" style="width: 100%;height: 100%;">
                </div>
                <div class="btn btn-primary add-pic-btn">上传图片</div>
            </div>
        </div>

        <div class="form-group" ng-class="{'has-error':form.commentIdentity.$invalid}" ng-if="information.item.type=='3'">
            <label class="col-sm-2 control-label">
                <span class="required">*</span> 评论人身份
            </label>
            <div class="col-sm-8">
                <input type="text" class="form-control" maxlength="100" autocomplete="off" value="" name="commentIdentity" ng-model="information.item.commentIdentity" required="required" placeholder="评论人身份">
            </div>
        </div>
        <div class="form-group" ng-class="{'has-error':form.commentPosition.$invalid}" ng-if="information.item.type=='3'">
            <label class="col-sm-2 control-label">
                <span class="required">*</span> 评论人职称
            </label>
            <div class="col-sm-8">
                <input type="text" class="form-control" maxlength="10" autocomplete="off" value="" name="commentPosition" ng-model="information.item.commentPosition" required="required" placeholder="评论人职称">
            </div>
        </div>
        <div class="form-group" ng-class="{'has-error':form.commentContent.$invalid}" ng-if="information.item.type=='3'">
            <label class="col-sm-2 control-label">
                <span class="required">*</span> 评论内容
            </label>
            <div class="col-sm-8">
                <textarea class="form-control" autocomplete="off" value="" rows="3" name="commentContent" ng-model="information.item.commentContent" required="required" placeholder="评论内容"></textarea>
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-6"></div>
            <div class="col-sm-6">
                <input type="submit" class="btn btn-primary" value="保存" />
            </div>
        </div>
    </form>
</div>
<div load-script src="'/static/jquery.jUploader-1.01.js?5'" call-back="" charset="utf-8" ></div>
